package yunjiao.designpatterns.interpreter;

/**
 * TODO
 *
 * @author yangyunjiao
 */
public class Subtraction implements Expression{
    private final Expression left;
    private final Expression right;

    public Subtraction(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public double interpret() {
        return left.interpret() - right.interpret();
    }
}
